
using System ;

class Calc {

public static void Main ( string[] args )
{
    Console.WriteLine ("Desk Calculator: operators are *, /, +, -, ^, () \n");
    //if ( args.Length != 1 ) {
    //    Console.WriteLine ( "Usage:  calc  expression\n" );
    //    return; 
    //}

    var str = Console.ReadLine();

    SlkToken scanner = new SlkToken(str);
    SlkError    error = new SlkError ( scanner );
    SlkAction   action = new SlkAction ( scanner );

    SlkParser.parse  ( action, scanner, error, (short) 0 );

    Console.WriteLine ( "Answer = " + action.get_answer() );

    Console.WriteLine ("=====================" );
    Console.WriteLine ("show_parse_derivation" );
    Console.WriteLine ("=====================" );
    action.show_parse_derivation ();
    Console.WriteLine ("=====================" );
    Console.WriteLine ("show_tree" );
    Console.WriteLine ("=====================" );
    action.show_tree ();
    Console.WriteLine ("=====================" );
    Console.Write(str);
    Console.WriteLine ( " = " + action.get_answer() );

    Console.ReadLine();

}

}; 
